package com.its.cloud.controller;

import com.its.cloud.entity.ResultBean;
import com.its.cloud.service.AccountService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author huguangjun
 * @className AccountController
 * @date 2021/1/18
 * @desc 11:17
 */
@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    @RequestMapping("/account/decrease")
    public ResultBean decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money) {
        accountService.decrease(userId, money);
        return new ResultBean("扣减账户余额成功");
    }
}
